package com.example.administrator.yunniuusedcar.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.administrator.yunniuusedcar.R;
import com.example.administrator.yunniuusedcar.model.mode_benn.WZ_ArticleInfoBean;
import com.squareup.picasso.Picasso;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.util.List;

/**  文章 详情 --- 活动咨询
 * Created by Administrator on 2017/12/20.
 */

    public class ArticleInfoAdapter extends CommonAdapter<WZ_ArticleInfoBean> {

    public ArticleInfoAdapter(Context context, int layoutId, List<WZ_ArticleInfoBean> datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder holder, WZ_ArticleInfoBean data, int position) {

          holder.setText(R.id.tv_infomationTitle,data.data.title);
            holder.setText(R.id.tv_infomationTime,"时间："+data.data.add_time);
            holder .setText(R.id.tv_infomationSoure,"来源："+ data.data.source);
   //     holder .setText(R.id.tv_infomationFrom,data.data.content);      //资讯详情
        ImageView a =( (ImageView) holder.getView(R.id.iv_infomationPage));
        a.setImageResource(R.mipmap.ic_launcher);
        String b = data.data.logo;
        Context c = holder.itemView.getContext();
//        Glide.with(c).load(b).into(a);
        Picasso.with(c).load(b).into(a);
    }
}
